package com.sunnada.weixin.util.weixinPay;

public interface Config {
	
	public interface KeyNames {
		public static final String ORDER_NO = "OrderNo";//订单号
		public static final String ORDER_NO_NEW = "NewOrderNo";//订单号
		public static final String DATA = "Data";//数据
		public static final String RET_CODE = "RetCode";//返回编码
		public static final String RET_MSG = "RetMsg";//返回描述
		
		//RetPayCode
		public static final String RESULT_CODE = "Result_Code";//返回编码
		public static final String RESULT_MSG = "Result_Msg";//返回编码
	}
	
	public interface BuynumOrderStep {
		public static final String INIT = "1";//订单
		public static final String OCCUPY_NUM = "2";//号码预占
		public static final String FEE_INFO = "3";//获取费用
		public static final String PAY = "4";//支付
		public static final String SUBMIT = "5";//提交
		public static final String GET_CARD_INFO = "6";//获取卡数据
		public static final String SUBMIT_CARD = "7";//卡数据提交
	}
	
	public interface BusiType {
		
		/*
		 * 登陆标识
		 */
		public static final String LOGIN = "0002";//登录
		
		/*
		 * 3G4G号卡标识，根据0902 NetType字段进行3G、4G业务类型判断
		 */
		public static final String GET_ORDERNO = "0901";//获取订单
		public static final String QUERY_NUM = "0902";//号卡销售选号
		public static final String CHECK_NUM = "0903";//号码预占
		public static final String QUERY_FEE = "0904";//获取费用
		public static final String ORDER_SUBMIT = "0905";//开户订单提交
		public static final String RESULT_NOTIFY = "0906";//提交写卡结果
		public static final String RE_GET_CARD_DATA = "0907";//再次提交获取写卡数据
		public static final String EXIT = "0908";//退出号卡流程

		/*
		 * 余额和账单查询
		 */
		public static final String SEARCH_MONEY_GET_ORDERNO      = "0c01"; //话费查询获取订单号
		public static final String SEARCH_MONEY_GET_VERCODE		 = "0c02"; //话费查询获取验证码
		public static final String SEARCH_MONEY_CHECK_VERCODE    = "0c03"; //话费查询校验验证码
		public static final String SEARCH_MONEY_SBUMIT           = "0c04"; //话费查询提交查询
		public static final String SEARCH_MONEY_EXIT 			 = "0c05"; //话费查询退出流程
		
		/*
		 * 支付业务类型
		 */
		public static final String PAY_CASH_MONEY        = "1001"; //预存支付请求
		public static final String PAY_USER_MONEY		  = "2001"; //商户账户充值
		public static final String PAY_SEARCH_MONEY      = "3001"; //查询余额
		public static final String PAY_AIL_INFO           = "3002"; //支付宝计算签名
		public static final String PAY_AIL_CHECK 			 = "3003"; //验证支付宝签名
		public static final String PAY_AIL_RESULT 			 = "3004"; //查询支付订单结果
		public static final String PAY_KEY_CHANGE 			 = "3005"; //渠道平台更换密钥
		public static final String PAY_CASH_FLUSHES 			 = "4001"; //预存支付冲正
		public static final String PAY_USER_FLUSHES 			 = "4002"; //商户充值冲正
		public static final String PAY_AIL_FLUSHES 			 = "4003"; //支付宝退款
	}
	
	/*
	 * 业务返回值
	 */
	public enum RetCode {
		//MINI业务返回值
		SUCCESS_ORDER_SUBMIT("1000", "订单提交成功"),
		SUCCESS("2000", "交易成功"),
		ERROR_PARAM_EMPTY("L997", "请求参数为空"),
		ERROR_RETURN("L998", "返回数据解析异常"),
		ERROR_RETURN_EMPTY("L999", "返回数据为空"),
		ERROR_ORDER_TIMEOUT("4444", "订单超时"),
		ERROR_PAY_PWD("1004", "交易密码不正确"),
		ERROR_OTHER("9999", "其它错误");
		
		public String code;
		public String msg;
		RetCode(String code, String msg) {this.code=code; this.msg=msg;}
		public static RetCode codeValueOf(String code) {
			for(RetCode en : RetCode.values()) {
				if(en.toString().equals(code)) {
					return en;
				}
			}
			return RetCode.ERROR_OTHER;
		}
	}
	
	
	/*
	 * 支付返回值
	 */
	public enum RetPayCode {

		SUCCESS_PAY("0000", "成功"),
		ERROR_NULL_OF_CHANNEL("1000", "商户不存在"),
		ERROR_KEY("1001", "商户密钥不正确"),
		ERROR_NULL_OF_USER("1002", "账户信息不存在"),
		ERROR_NULL_OF_ORDER("3000", "订单号不存在，或已经退款"),
		ERROR_RETURN_EMPTY("L999", "返回数据为空"),
		ERROR_TIMEOUT("9000", "系统忙，稍后再试");
		
		public String code;
		public String msg;
		RetPayCode(String code, String msg) {this.code=code; this.msg=code;}
		public static RetPayCode codeValueOf(String code) {
			for(RetPayCode en : RetPayCode.values()) {
				if(en.toString().equals(code)) {
					return en;
				}
			}
			return RetPayCode.ERROR_TIMEOUT;
		}
	}
	
	public interface KEY {
		public static final String ERR_CODE = "errcode";
		public static final String ERR_MSG = "errmsg";
		public static final String NICK_NAME = "nickname";
		public static final String HEAD_IMG_URL = "headimgurl";
		public static final String ACCESS_TOKEN = "access_token";
		public static final String TICKET = "ticket";
		public static final String QRCODE = "qrcode";
		public static final String MEDIA = "media";
		public static final String MEDIA_ID = "media_id";
		public static final String OPEN_ID_1 = "OpenId";
		public static final String OPEN_ID_2 = "openid";
		public static final String PREPAY_ID = "prepay_id";
		public static final String CODE_URL = "code_url";
		public static final String PACKAGE = "package";
		public static final String NONCESTR = "nonceStr";
		public static final String TIMESTAMP = "timeStamp";
		public static final String APPID = "appId";
		public static final String SIGN_TYPE = "signType";
		public static final String PAY_SIGN = "paySign";
		public static final String RETURN_CODE = "return_code";
		public static final String RESULT_CODE = "result_code";
		public static final String RETURN_MSG = "return_msg";
		
		
		public static final String QR_SCENE = "QR_SCENE";
		public static final String QR_LIMIT_SCENE = "QR_LIMIT_SCENE";
		public static final String QR_LIMIT_STR_SCENE = "QR_LIMIT_STR_SCENE";
	}
	
	public interface EVENT {
		/**
		 * 事件类型：subscribe(订阅) 
		 */
		public static final String EVENT_TYPE_SUBSCRIBE = "subscribe";

		/**
		 * 事件类型：unsubscribe(取消订阅) 
		 */
		public static final String EVENT_TYPE_UNSUBSCRIBE = "unsubscribe";

		/**
		 * 事件类型：CLICK(自定义菜单点击事件) 
		 */
		public static final String EVENT_TYPE_CLICK = "CLICK";
	}
	
	public interface MENU_CLICK {
		public static final String INFO_COMPANY = "INFO_COMPANY";
		public static final String MEDIA_QRCODE = "MEDIA_QRCODE";
		
		
		public static final String DISTRIBUTION_DESCRIPTION = "DISTRIBUTION_DESCRIPTION";//配送说明
		public static final String CONTACT_CUSTOMER = "CONTACT_CUSTOMER";//联系客服
	}
	
	public static final class WX_CODE {
		public static final String SUCCESS = "0";
	}		

}
